<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>姓名案例_插值语法实现</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
     <div id = "name">
        姓：<input type="text" v-model:value="firstName"></input><br/> <!---双向绑定对data进行数据修改-->
        名：<input type="text" v-model:value="lastName"></input><br/>
        姓名：<span>{{firstName}} - {{lastName}}</span>
        <!-- 姓名：<span>{{firstName + "-" + lastName}}</span> -->
     </div>
     <script>
        new Vue({
            el: '#name',
            data:function(){
                return {
                    firstName:'张',
                    lastName:'三'
                }
            }
        })
     </script>
</body>
</html>